<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<div class="mainBody">
    <div class="btnArea floatFix">
        <div class="leftBtn" onclick="javascript:location.href='<?php echo backend_url('account/add'); ?>'">
        	<div class="absolute">
	            <div class="btnIcon addIcon"></div>
	            <p class="btnName fontDinproMedium">ADD USER</p>
	        </div>
        </div>
        <div class="selectorDiv btnAreaFix">
            <div class="selectorName fontDinpro">User Role</div>
            <div class="locationGroup listGroupDown listGroup">
                <a class="btnLeft btnPrimary fontDinpro" data-toggle="dropdown" href="javascript:void(0)" link="">
                    <?php
                    switch($role){
                        case "":
                            echo "All";
                            break;
                        default:
                            echo $roles[$role];
                    }
                    ?>
                </a>
                <a class="btnRight btnPrimary" data-toggle="dropdown" href="javascript:void(0)"><span class="caretBottom"></span></a>
                <ul class="dropDownList fontDinpro">
                    <li>
                        <a href="javascript:void(0)" class="fontDinpro" link="<?php echo backend_url('account/view'); ?>/">
                            All
                        </a>
                    </li>
                    <?php foreach($roles as $k=>$r): ?>
                        <li>
                            <a href="javascript:void(0)" class="fontDinpro" link="<?php echo backend_url('account/view'); ?>/<?php echo $k; ?>">
                                <?php echo $r; ?>
                            </a>
                        </li>
                    <?php endforeach; ?>
                </ul>
            </div>
        </div>
    </div>
    <div class="tableContent">
        <table class="fontDinpro">
            <thead>
            <tr>
                <th style="width: 120px;">Real Name</th>
                <th style="width: 120px;">User Name</th>
                <th style="min-width: 80px;">User Email</th>
                <th style="width: 120px;">User Role</th>
                <th style="width: 120px;">Status</th>
                <th style="width: 180px; min-width: 160px;">Options</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td style="width: 120px;">Real Name</td>
                <td style="width: 120px;">User Name</td>
                <td>User Email</td>
                <td style="width: 120px;">User Role</td>
                <td style="width: 120px;">Status</td>
                <td style="width: 180px;">Options</td>
            </tr>
            <?php foreach($list as $v) : ?>
                <tr class="lowTr">
                    <td><?php echo $v->rname; ?></td>
                    <td><?php echo $v->uname; ?></td>
                    <td><?php echo $v->email; ?></td>
                    <td><?php echo $roles[$v->role]; ?></td>
                    <td>
                        <span class="colorLabel <?php echo $v->status == 1 ? 'bgGreen' : 'bgRed'; ?>"><?php echo $v->status == 1 ? 'Normal' : 'Locked'; ?></span>
                    </td>
                    <td>
                        <button class="tableBtn" onclick="location.href='<?php echo backend_url('account/edit/'.$v->uid); ?>'">
                        	<div class="editIcon"></div>Edit
                        </button>
                        <button class="tableBtn" onclick="location.href='<?php echo backend_url('account/del/'.$v->uid); ?>'">
                        	<div class="delIcon"></div>Delete
                        </button>
                    </td>
                </tr>
            <?php endforeach; ?>
            <tr style="height: 33px;"></tr>
            </tbody>
        </table>
    </div>
    <div class="changePage"><?php echo $pagination; ?></div>
</div>
